﻿using System;

using DevExpress.Xpo;

using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.Data.Filtering;

namespace SpeedSCM.Module
{
    [DefaultClassOptions]
    [ImageName("BO_Note")]
    [Custom("IsCreatableItem", "False")]
    public class 通知 : BaseObject
    {
        public 通知(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here or place it only when the IsLoading property is false:
            // if (!IsLoading){
            //    It is now OK to place your initialization code here.
            // }
            // or as an alternative, move your initialization code into the AfterConstruction method.
        }
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
            创建时间 = DateTime.Now;
        }
        private string _标题;
        [Custom("Caption", "标题")]
        [RuleRequiredField(null, DefaultContexts.Save, "请填写通知的标题")]
        public string 标题
        {
            get { return _标题; }
            set { SetPropertyValue<string>("标题", ref _标题, value); }
        }
        private DateTime _创建时间;
        [Custom("Caption", "创建时间")]
        [Custom("EditMask", "F")]
        [Custom("DisplayFormat", "F")]
        [RuleRequiredField(null, DefaultContexts.Save, "请填写通知的创建时间")]
        public DateTime 创建时间
        {
            get { return _创建时间; }
            set { SetPropertyValue<DateTime>("创建时间", ref _创建时间, value); }
        }

        private string _内容;
        [Custom("Caption", "内容")]
        [Size(500)]
        public string 内容
        {
            get { return _内容; }
            set { SetPropertyValue<string>("内容", ref _内容, value); }
        }
    }
}
